<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../../include/publicMeta.jsp"%>

<article class="cl pd-20">
    <form action="/config/addRole" method="post" class="form form-horizontal" id="form-admin-role-add" target="_parent">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>角色名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="" id="roleName" name="name" required>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">角色描述：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="" id="roleDesc" name="desc_">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-success radius" id="admin-role-save" name="admin-role-save"><i class="icon-ok"></i> 确定</button>
            </div>
        </div>
    </form>
</article>

<%@include file="../../include/publicFooter.jsp"%>
<script type="text/javascript">
    $(function(){
        $("#form-admin-role-add").validate({
            rules:{
                name:{
                    required: true,
                    minlength: 4,
                    maxlength: 16
                }
            },
            messages:{
                name:{
                    required: "请输入角色名称",
                    minlength: "角色名称至少需要4个字符",
                    maxlength: "角色名称最多16个字符"
                }
            },
            onkeyup: false,
            focusCleanup: true,
            success: "valid",
            submitHandler: function(form) {
                form.submit();
            }
        });
    });
</script>
</body>
</html>
